//
//      Copyright Timothy Evans 2014 2015    timothy.evans@gsecraif.org
//
//      This file is part of gsecraif.
//
//      gsecraif is free software; you can redistribute it and/or modify
//      it under the terms of the GNU General Public License as published by
//      the Free Software Foundation; either version 3 of the License, or
//      (at your option) any later version.
//
//      See gsecraif.cpp
//
// =====================================================================
//
//! Convert integer 0 to 999 to 3 char string.
//
// =====================================================================
// 
// Compile with g++
using namespace std;
#include "int2asciistr.h"
	
void int2asciistr( string &str, unsigned int j) {	
// convert integer 0 to 999 to 3 char string with leading zeros
assert (j < 1000);
if (j < 1000) {


// ascii "0" = 48	
    str[0] = (j/100)+48;
    str[1] = ((j%100)/10)+48;
    str[2] = (j%10)+48;
    }
}
